let  arr1: readonly number[] = [1,2];
let  arr2:Array<number> = [1];
//arr2=arr1  报错
arr1 = arr2


//只读数组声明方式
const  a:readonly number[] =[1];
const  b:Readonly<number[]> =[1];
const  c:ReadonlyArray<number> =[1]


// 元组
// 不限制成员个数
type NameNums =[string, ...number[]]
// 添加成员名
type Color = [
  red: number,
  green: number,
  blue: number
];
const color1:Color = [255, 255, 255];
// 获取元组成员的联合类型
type Tuple = [string, number, Date];
type TupleEl = Tuple[number];  // string|number|Date

// 只读元组
type rt1 = readonly [string, number];
type rt2 = Readonly<[string, number]>;